﻿@using FwProject.ManagerConfig.Dto
@using FwProject.Authorization
@model ConfigInfoDto
@{
    ViewBag.Title = "公司管理";
}
@section styles{

    <link href="~/Theme/css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="~/Theme/css/plugins/datapicker/datepicker3.css" rel="stylesheet">
    <link href="~/Theme/js/plugins/layer/skin/layer.css" rel="stylesheet" />
    <link href="~/Scripts/webuploader-0.1.5/webuploader.css" rel="stylesheet" />
    <link href="~/Scripts/fancybox-2.1.7/source/jquery.fancybox.css" rel="stylesheet" media="screen" />
    <link href="~/Theme/css/plugins/jsTree/style.min.css" rel="stylesheet" />
    <style type="text/css">
        .input-group[class*=col-] {
            padding: 0 15px;
        }
    </style>
}
<div class="row wrapper wrapper-content animated fadeInRight">
    <div class="col-sm-12">
        <div class="ibox float-e-margins">
            <div class="ibox-title">
                <h5>@ViewBag.Title</h5>
                <div class="ibox-tools">
                    @if (Model == null)
                    {
                        <button class="btn btn-primary btn-xs" id="btnSave">保存</button>
                    }
                    else
                    {
                        <button class="btn btn-primary btn-xs" id="btnEdit">保存</button>
                    }

                </div>
            </div>
            <div class="ibox-content">
                @if (Model != null)
                {
                    <form class="form-horizontal" id="form1" action="/MConfig/Update?id=@Model.Id" data-ajax="true" data-ajax-update="#data_list" data-ajax-method="Get" data-ajax-mode="replace" data-ajax-success="ReloadAjaxCallbackgoback" data-ajax-failure="FailureAjaxCallback">
                        <div id="data_list">

                            <div class="form-group">
                                <div class="col-md-6">
                                    <label class="control-label col-md-3" style="width:90px">公司名称：</label>
                                    <div class="input-group">
                                        <input type="text" name="CorporateName" class="input-sm form-control" value="@Model.CorporateName" style="width:585px" autocomplete="off"/>
                                    </div>
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-md-3" style="width:389px">
                                    <label class="control-label col-md-3" style="width:90px">公司简称：</label>
                                    <div class="input-group">
                                        <input type="text" name="Abbreviation" class="input-sm form-control" value="@Model.Abbreviation" autocomplete="off"/>
                                    </div>
                                </div>
                                <div class="col-md-3">
                                    <label class="control-label col-md-3" style="width:90px">公司电话：</label>
                                    <div class="input-group">
                                        <input type="text" name="CorporateMobile" class="input-sm form-control" value="@Model.CorporateMobile" autocomplete="off"/>
                                    </div>
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-md-6">
                                    <label class="control-label col-md-3" style="width:90px">注册人：</label>
                                    <div class="input-group">
                                        <input type="text" name="RegisterUser" class="input-sm form-control" value="@Model.RegisterUser.Name             (注册时间：@Model.RegisterDate)" readonly="readonly" style="width:585px" />
                                    </div>
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-md-6">
                                    <label class="control-label col-md-3" style="width:90px">公司地址：</label>
                                    <div class="input-group">
                                        <input type="text" name="CorporateAddress" class="input-sm form-control" value="@Model.CorporateAddress" style="width:585px" autocomplete="off"/>
                                    </div>
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-md-12">
                                    <label class="control-label col-md-3" style="width:90px">收款收据：</label>
                                    <div class="col-md-3" style="width:200px">
                                        <label class="control-label col-md-3" style="width:80px">会计：</label>
                                        <div class="input-group">
                                            <input type="text" name="Accountant" class="input-sm form-control" value="@Model.Accountant" autocomplete="off"/>
                                        </div>
                                    </div>
                                    <div class="col-md-3" style="width:200px">
                                        <label class="control-label col-md-3" style="width:80px">出纳：</label>
                                        <div class="input-group">
                                            <input type="text" name="Cashier" class="input-sm form-control" value="@Model.Cashier" autocomplete="off"/>
                                        </div>
                                    </div>
                                    <div class="col-md-3" style="width:200px">
                                        <label class="control-label col-md-3" style="width:80px">经办人：</label>
                                        <div class="input-group">
                                            <input type="text" name="AgentPerson" class="input-sm form-control" value="@Model.AgentPerson" autocomplete="off"/>
                                        </div>
                                    </div>
                                </div>

                            </div>
                        </div>
                    </form>
                }
                else
                {
                    <form class="form-horizontal" id="form0" asp-controller="MConfig" asp-action="Save" data-ajax="true" data-ajax-update="#data_list" data-ajax-method="Get" data-ajax-mode="replace" data-ajax-success="ReloadAjaxCallbackgoback" data-ajax-failure="FailureAjaxCallback">
                        <div id="data_list">
                            <div class="form-group">
                                <div class="col-md-6">
                                    <label class="control-label col-md-3" style="width:90px">公司名称：</label>
                                    <div class="input-group">
                                        <input type="text" name="CorporateName" class="input-sm form-control" value="" style="width:585px" autocomplete="off"/>
                                    </div>
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-md-3" style="width:389px">
                                    <label class="control-label col-md-3" style="width:90px">公司简称：</label>
                                    <div class="input-group">
                                        <input type="text" name="Abbreviation" class="input-sm form-control" value="" autocomplete="off"/>
                                    </div>
                                </div>
                                <div class="col-md-3">
                                    <label class="control-label col-md-3" style="width:90px">公司电话：</label>
                                    <div class="input-group">
                                        <input type="text" name="CorporateMobile" class="input-sm form-control" value="" autocomplete="off"/>
                                    </div>
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-md-6">
                                    <label class="control-label col-md-3" style="width:90px">公司地址：</label>
                                    <div class="input-group">
                                        <input type="text" name="CorporateAddress" class="input-sm form-control" value="" style="width:585px" autocomplete="off"/>
                                    </div>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="control-label col-md-3" style="width:90px">收款收据：</label>
                                <div class="col-md-3" style="width:200px">
                                    <label class="control-label col-md-3" style="width:80px">会计：</label>
                                    <div class="input-group">
                                        <input type="text" name="Accountant" class="input-sm form-control" value="" autocomplete="off"/>
                                    </div>
                                </div>
                                <div class="col-md-3" style="width:200px">
                                    <label class="control-label col-md-3" style="width:80px">出纳：</label>
                                    <div class="input-group">
                                        <input type="text" name="Cashier" class="input-sm form-control" value="" autocomplete="off"/>
                                    </div>
                                </div>
                                <div class="col-md-3" style="width:200px">
                                    <label class="control-label col-md-3" style="width:80px">经办人：</label>
                                    <div class="input-group">
                                        <input type="text" name="AgentPerson" class="input-sm form-control" value="" autocomplete="off"/>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </form>

                }

            </div>
        </div>
    </div>
</div>

@section scripts{
    <script src="~/Theme/js/content.min.js?v=1.0.0"></script>
    <script src="~/Theme/js/plugins/iCheck/icheck.min.js"></script>
    <script src="~/Theme/js/plugins/datapicker/bootstrap-datepicker.js"></script>
    <script src="~/Theme/js/content.min.js?v=1.0.0"></script>
    <script src="~/Theme/js/plugins/iCheck/icheck.min.js"></script>
    <script src="~/Theme/js/plugins/datapicker/bootstrap-datepicker.js"></script>
    <script src="~/Scripts/webuploader-0.1.5/webuploader.min.js"></script>
    <script src="~/Theme/js/plugins/suggest/bootstrap-suggest2014.js"></script>
    <script src="~/Scripts/fancybox-2.1.7/source/jquery.fancybox.js"></script>
    <script src="~/Theme/js/plugins/jsTree/jstree.min.js"></script>
    <script src="~/Scripts/jquery.treegrid.min.js"></script>
    <script type="text/javascript">

        $(document).ready(function () {

            $('#btnSave').click(function () {
                $('#form0').submit();
            });

            $('#btnEdit').click(function () {
                $('#form1').submit();
            });
        });

        function ReloadAjaxCallbackgoback(data, successInfo) {
            CommonAjaxCallback(data, function () {
                window.location.reload();
            }, successInfo);
        }
    </script>
}